#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define N 100
int k1 = 0, k2 = 0, k3 = 0;

char encryptedmsg[N];
char decryptedmsg[N];
int len = 0;

char lg1[N];
int  lp1[N];
int  l1 = 0;
char lg2[N];
int  lp2[N];
int  l2 = 0;
char lg3[N];
int  lp3[N];
int  l3 = 0;


void statistic()
{
    int i = 0;
    l1 = l2 = l3 = 0;
    for(i = 0; i < len; i++)
    {
        if(encryptedmsg[i] >= 'a' && encryptedmsg[i] <= 'i')
        {
            lg1[l1] = encryptedmsg[i];
            lp1[l1] = i;
            l1++;
        }
        else if(encryptedmsg[i] >= 'j' && encryptedmsg[i] <= 'r')
        {
            lg2[l2] = encryptedmsg[i];
            lp2[l2] = i;
            l2++;
        }
        else
        {
            lg3[l3] = encryptedmsg[i];
            lp3[l3] = i;
            l3++;
        }
    }
}

void rotations(char lg[N], int lp[N], int len, int k)
{
    int i = 0;

    for(i = 0; i < len; i++)
    {
        decryptedmsg[lp[(i+k)%len]] = lg[i];
    }
}

void decryptedmsgprint()
{
    printf("%s\r\n", decryptedmsg);

}

void process()
{
    strcpy(decryptedmsg, encryptedmsg);
    len = strlen(encryptedmsg);

    statistic();

    rotations(lg1, lp1, l1, k1);
    rotations(lg2, lp2, l2, k2);
    rotations(lg3, lp3, l3, k3);

    decryptedmsgprint();
}

int main()
{
    //freopen("bin\\debug\\in.txt", "r", stdin);

    scanf("%d %d %d", &k1, &k2, &k3);
    while(k1 != 0 || k2 != 0 || k3 != 0)
    {
        scanf("%s", encryptedmsg);
        process();

        scanf("%d %d %d", &k1, &k2, &k3);
    }

    return 0;
}
